#include <iostream>
#include<vector>
using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<vector<int>> prev(n+1,vector<int>(n+1,0));
    for(int i = 1;i<=n;i++)
    {
        string tmp;
        cin>>tmp;
        for(int j = 1;j<=n;j++)
        {
            prev[i][j] = prev[i][j-1]+prev[i-1][j] - prev[i-1][j-1]+(tmp[j-1] == '1'?1:0);
        }
    }//填充prev数组
    vector<int> ans(n,0);
    for(int i = 1;i<=n;i++)
    {
        if(i%2!=0)
        {
            ans[i] = 0;
            continue;
        }//奇数不可能是答案
        else 
        {
           int res_zero = (i*i)/2;
           int count = 0;
           for(int r = 1;r<=n-i+1;r++)
           {
                for(int c = 1;c<=n-i+1;c++)
                {
                    int one = prev[r+i-1][c+i-1] - prev[r-1][c+i-1] - prev[r+i-1][c-1]+prev[r-1][c-1];
                    int zero = i*i - one;
                    if(zero == res_zero)
                    {
                        count++;
                    }
                }
           }//枚举所有的i*i的子矩阵
           ans[i-1] = count;
        }
    }
    for(int e:ans)
    {
        cout<<e<<endl;
    }
    return 0;
}